﻿using System;
using System.Windows.Forms;
using Demo.TspDemo.ServiceSSVG;
using Demo.TspDemo;
namespace Net_Trading
{
    public partial class fen_login : Form
    {
      
        public fen_login()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if ((textEdit1.Text == "") || (textEdit2.Text == ""))
            {
                label5.Show();
            }
            else
            {
                using (Service1 serv = new Service1())
                {
                    Singleton s = Singleton.Instance;
                    Employer emp = serv.Connxionemployee(textEdit1.Text, textEdit2.Text, comboBoxEdit1.SelectedIndex);
                    if (emp != null)
                    {
                        s.Emp = emp;
                        fen_main m = new fen_main();
                        Hide();
                        m.Show();
                    }
                    else
                        label5.Show();
                }
            }
        }

        private void textEdit1_Enter(object sender, EventArgs e)
        {
            label5.Hide();
        }

        private void textEdit2_Enter(object sender, EventArgs e)
        {
            label5.Hide();
        }
    }
}
